class GpsHistory < ActiveRecord::Base
  #根据起止时间和车号查找车辆的gps历史
  #return [gps1, gps2]
  def self.query_gps_history_in_period(period)
    if period
      start_time = period[:start]
      end_time = period[:end]
      vehicle_no = period[:vehicle_no]
      return self.where("time > ? and time < ? and vehicle_no = ? ", start_time, end_time, vehicle_no ).order("time ASC").all
    end
    return nil
  end


end
